using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using DATA.BusinessObjects;
using DATA.Base;

namespace DATA.ManagerObjects
{
    public partial interface IChitiethoadonManager : IManagerBase<DATA.BusinessObjects.Chitiethoadon, string>
    {
		// Get Methods
		IList<Chitiethoadon> GetByMaHoaDon(System.String hoadon);
		IList<Chitiethoadon> GetByMaPhieuThuePhong(System.String phieuthuephong);
    }

    partial class ChitiethoadonManager : ManagerBase<DATA.BusinessObjects.Chitiethoadon, string>, IChitiethoadonManager
    {
		#region Constructors
		
		public ChitiethoadonManager() : base()
        {
        }
        public ChitiethoadonManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Chitiethoadon> GetByMaHoaDon(System.String hoadon)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Chitiethoadon));
			
			
			ICriteria hoadonCriteria = criteria.CreateCriteria("Hoadon");
            hoadonCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", hoadon));
			
			return criteria.List<Chitiethoadon>();
        }
		
		public IList<Chitiethoadon> GetByMaPhieuThuePhong(System.String phieuthuephong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Chitiethoadon));
			
			
			ICriteria phieuthuephongCriteria = criteria.CreateCriteria("Phieuthuephong");
            phieuthuephongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", phieuthuephong));
			
			return criteria.List<Chitiethoadon>();
        }
		
		#endregion
    }
}